function $KapsTopObserver(){
    //private
    var observers=[];
    var possEvt=["kt_load"];
    var err="";
    var isValidEvent = function(event){
        for(var i=0;i<possEvt.length;i++){
            if(possEvt[i].match(event)){
                return true;
            }
        }
        return false;
    }
    
    //public
    this.observe = function(obj,event){
        if(typeof obj === "object"){
            if(typeof obj.notify === "function"){
                if(isValidEvent(event)){
                    if(typeof observers[event] === "undefined"){
                        observers[event] = new Array();
                    }
                    observers[event].push(obj);
                }else{
                    err="event not allowed";
                    return false;
                }
            }else{
                err="Object in parameter 1 do not have notify function.";
                return false;
            }
        }else{
            err="Parameter 1 is not an object.";
            return false;
        }
    }
    this.getErrorMessage = function(){
        return err;
    }
}
